<form class="form-horizontal form-validate" action="{php echo webUrl('commission/apply/changecommission')}" method="post" enctype="multipart/form-data">
    <input type='hidden' name='id' value="{$order['id']}" />

    <div class="modal-dialog" style='width:800px;'>
        <div class="modal-content">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button">×</button>
                <h4 class="modal-title">修改佣金 订单号: {$order['ordersn']}</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">粉丝</label>
                    <div class="col-sm-9 col-xs-12">
                        <img src='{$member['avatar']}' style='width:30px;height:30px;padding:1px;border:1px solid #ccc' />
                        {$member['nickname']}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">会员信息</label>
                    <div class="col-sm-9 col-xs-12">
                        <div class='form-control-static'>ID: {$member['id']} 姓名: {$member['realname']} / 手机号: {$member['mobile']} /微信号: {$member['weixin']}</div>
                    </div>
                </div>
                {php $canchangeall = true;}
                <div class="form-group">


                    <table class='table' style='table-layout: fixed;'>
                        <tr>
                            <th style='width:150px;;'>商品名称</th>
                            <th style='width:50px;;'>数量</th>
                            <th style='width:80px;'>小计</th>
                            {if $set['level']>=1 && !empty($cm1)}
                            <th style='width:145px;'>
                                1级</th>
                            {/if}
                            {if $set['level']>=2  && !empty($cm2)}
                            <th style='width:145px;'>
                                2级</th>
                            {/if}
                            {if $set['level']>=3  && !empty($cm3)}
                            <th style='width:145px;'>
                                3级</th>
                            {/if}
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            {if $set['level']>=1 && !empty($cm1) }
                            <td>
                                <a href="{php echo webUrl('member/list/detail',array('id'=>$cm1['id']))}" target='_blank'><img src="{php echo tomedia($cm1['avatar'])}" style='width:30px;height:30px;padding:1px;border:1px solid #ccc' /> {$cm1['nickname']}</a>
                            </td>
                            {/if}
                            {if $set['level']>=2  && !empty($cm2)}
                            <td style='width:100px;'>
                                <a href="{php echo webUrl('member/list/detail',array('id'=>$cm2['id']))}" target='_blank'><img src="{php echo tomedia($cm2['avatar'])}" style='width:30px;height:30px;padding:1px;border:1px solid #ccc' /> {$cm2['nickname']}</a>
                            </td>
                            {/if}
                            {if $set['level']>=3  && !empty($cm3)}
                            <td style='width:100px;'>
                                <a  href="{php echo webUrl('member/list/detail',array('id'=>$cm3['id']))}" target='_blank'><img src="{php echo tomedia($cm3['avatar'])}" style='width:30px;height:30px;padding:1px;border:1px solid #ccc' /> {$cm3['nickname']}</a>
                            </td>
                            {/if}
                        </tr>
                        {loop $order_goods_change $goods}
                        {if !empty($goods['status1']) ||!empty($goods['status2']) ||!empty($goods['status3'])} {php $canchangeall =false;} {/if}
                        <tr>
                            <td style='overflow: hidden;'><img src="{php echo tomedia($goods['thumb'])}" style='width:30px;height:30px;padding:1px;border:1px solid #ccc' /> {$goods['title']}</td>
                            <td>{$goods['total']}</td>
                            <td>{$goods['realprice']}</td>
                            {if $set['level']>=1  && !empty($cm1)}<td><input type='text' class='form-control clevel' data-ogid='{$goods['id']}'  value="{$goods['c1']}" {if empty($goods['status1'])}data-canchange="1" data-level="1" name="cm1[{$goods['id']}]"{else}readonly{/if}  /></td>{/if}
                            {if $set['level']>=2  && !empty($cm2)}<td><input type='text' class='form-control clevel' data-ogid='{$goods['id']}'  value="{$goods['c2']}" {if empty($goods['status2'])}data-canchange="1" data-level="2" name="cm2[{$goods['id']}]"{else}readonly{/if} /></td>{/if}
                            {if $set['level']>=3  && !empty($cm3)}<td><input type='text' class='form-control clevel' data-ogid='{$goods['id']}'  value="{$goods['c3']}" {if empty($goods['status3'])}data-canchange="1" data-level="3" name="cm3[{$goods['id']}]"{else}readonly{/if} /></td>{/if}

                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td>应得</td>
                            {if $set['level']>=1  && !empty($cm1)}<td id='clevel1_sys_{$goods['id']}'>{$goods['co']['level1']}</td>{/if}
                            {if $set['level']>=2  && !empty($cm2)}<td id='clevel2_sys_{$goods['id']}'>{$goods['co']['level2']}</td>{/if}
                            {if $set['level']>=3  && !empty($cm3)}<td id='clevel3_sys_{$goods['id']}'>{$goods['co']['level3']}</td>{/if}
                        </tr>
                        {/loop}



                    </table>

                </div>
                <div class="form-group">

                    <div class="col-sm-9 col-xs-12">
                        <div class='form-control-static' style='color:red' >注: 不能修改的佣金为已申请或已结算</div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <a style='float:left' href="javascript:;" class="btn btn-success" onclick='commission_changeall()' >按应得重新设置佣金</a>
                <button class="btn btn-primary" type="submit">提交</button>
                <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
            </div>
        </div>
</form>
<script language='javascript'>
    function commission_changeall() {
        $('.clevel[data-canchange=1]').each(function(){
            $(this).val( $('#clevel' + $(this).data('level') + '_sys_' + $(this).data('ogid')).html());
        });
        tip.msgbox.suc('设置成功!');

    }
</script>
<!--913702023503242914-->